import torch
A = torch.tensor([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
B = torch.tensor([[1, 0, 0], [0, 1, 0], [0, 0, 1]])
print(A*B)
print("-"*10)
print(A@B)
print("-"*10)
A = torch.tensor([1, 2, 3])
B = torch.tensor([4, 5, 6])
print(torch.dot(A, B))
print("-"*10)
A = torch.tensor([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
B = torch.tensor([[1, 0, 0], [0, 1, 0], [0, 0, 1]])
# 下面两个方式计算结果相同 等价的
print(torch.matmul(A, B))
print(A@B)
